package org.sith.taskrunner.gwt.client.services.taskrunner;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.google.gwt.core.client.GWT;
import org.sith.taskrunner.gwt.shared.proxy.TaskToolkitEntityProxy;
import org.sith.taskrunner.gwt.shared.proxy.UserEntityProxy;

import java.util.List;


@RemoteServiceRelativePath("LoadInitDataService")
public interface LoadInitDataService extends RemoteService {


    UserEntityProxy loadCurrentUser();
    List<TaskToolkitEntityProxy> loadSystemToolkits();
    List<UserEntityProxy> loadUsers();

    List<TaskToolkitEntityProxy> loadToolkits(UserEntityProxy currentUser);


    /**
     * Utility/Convenience class.
     * Use LoadInitDataService.App.getInstance() to access static instance of LoadInitDataServiceAsync
     */
    public static class App {
        private static final LoadInitDataServiceAsync ourInstance = (LoadInitDataServiceAsync) GWT.create(LoadInitDataService.class);

        public static LoadInitDataServiceAsync getInstance() {
            return ourInstance;
        }
    }
}
